﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FactoryAndStrategy
{
    /// <summary>
    /// 扣款策略二
    /// </summary>
    public class FreeDeduction : IDeduction
    {
        /// <summary>
        /// 自由扣款
        /// </summary>
        /// <param name="card"></param>
        /// <param name="trade"></param>
        /// <returns></returns>
        public bool exec(Card card, Trade trade)
        {
            //直接從自由余額中扣除
            card.FreeMoney = card.FreeMoney - trade.Amount;
            return true;
        }
    }
}
